import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/subwayst/swStPlanTemp/page/delivery',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/subwayst/swStPlanTemp/',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/subwayst/swStPlanTemp/' + id,
    method: 'get'
  })
}

export function delObj(row) {
  return request({
    url: '/subwayst/swStPlanTemp/' + row.id,
    method: 'delete'
  })
}
//批量删除未下发的数据
export function delBatch(ids) {
  return request({
    url: '/subwayst/swStPlanTemp/delBatch',
    method: 'delete',
    data:ids
  })
}
export function putObj(obj) {
  return request({
    url: '/subwayst/swStPlanTemp/',
    method: 'put',
    data: obj
  })
}

export function sendBatch(ids) {
  return request({
    url: '/subwayst/swStPlanTemp/sendBatch',
    method: 'put',
    data: ids
  })
}

export function exportExcel(query) {
  return request({
    url: '/subwayst/swStPlanTemp/export',
    method: 'get',
    responseType:'blob',
    params: query
  })
}

/**
 * //车票临时计划配送和回收导入
 * @param body
 */
 export function ImportDeliveryTemp(body) {
  return request({
    url: "/subwayst/swStPlanTemp/ImportDeliveryTemp",
    headers: { "Content-Type": "multipart/form-data" },
    method: "post",
    data: body
  });
}
/**
 * 车票临时计划配送信息模板下载
 * @param {*} query 
 * @returns 
 */
 export function templateDeliveryTemp(query) {
  return request({
    url: "/subwayst/swStPlanTemp/exportTamplateDeliveryTemp",
    method: 'get',
    responseType: 'blob',
    params: query
  })
}